package com.chen.blue.service.business;

import com.chen.blue.base.FileBase;
import com.chen.blue.domain.delete.business.ContestApplyActiveDelete;
import com.chen.blue.domain.delete.system.RoleDelete;
import com.chen.blue.domain.dto.business.ContestApplyActiveDto;
import com.chen.blue.domain.dto.business.ContestResultDto;
import com.chen.blue.domain.dto.business.update.ContestApplyActiveDtoEdit;
import com.chen.blue.domain.dto.system.RoleDto;
import com.chen.blue.domain.dto.system.update.RoleDtoEdit;
import com.chen.blue.domain.model.business.ContestApplyActiveModel;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chen.blue.domain.query.business.ContestApplyActiveQuery;
import com.chen.blue.domain.query.system.RoleQuery;
import com.chen.blue.domain.vo.business.ContestApplyActiveVo;
import com.chen.blue.domain.vo.system.RoleVo;
import com.chen.blue.exception.e.DtoNullException;
import com.chen.blue.exception.e.NoDeleteException;
import com.chen.blue.result.DataResult;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 竞赛申请活动表 服务类
 * </p>
 *
 * @author CLT
 * @since 2024-05-23
 */
public interface IContestApplyActiveService extends IService<ContestApplyActiveModel> {

    /**
     * 开启第一阶段流程——添加竞赛申请
     *
     * @param contestApplyActiveDto
     * @return
     * @throws DtoNullException
     */
    boolean addContestApplyActive(ContestApplyActiveDto contestApplyActiveDto) throws DtoNullException, IOException;

    /**
     * 竞赛申请或者修改后保存，再上报
     *
     * @return
     */
    boolean reportAfterSaveOrUpdate(ContestApplyActiveDto contestApplyActiveDto) throws DtoNullException;

    /**
     * 竞赛驳回修改（第一阶段）
     *
     * @param contestApplyActiveDto
     * @return
     * @throws DtoNullException
     */
    boolean updateContestApplyActive(ContestApplyActiveDto contestApplyActiveDto) throws DtoNullException, IOException;

    /**
     * 开启第二阶段流程——人员信息审核
     *
     * @param activeId
     * @return
     */
    boolean addContestApplyRelationPerson(Long activeId) throws DtoNullException;

    /**
     * 开启第三阶段流程——竞赛结果审核
     *
     * @param activeId
     * @return
     */
    boolean addContestResult(Long activeId, ContestResultDto dto) throws DtoNullException;

    /**
     * 第一阶段流程审核——竞赛申请审核
     *
     * @param contestApplyActiveDtoEdit
     * @return
     * @throws DtoNullException
     */
    boolean updateContestApplyActiveById(ContestApplyActiveDtoEdit contestApplyActiveDtoEdit) throws DtoNullException;

    /**
     * 第二阶段流程审核——人员信息审核
     *
     * @param contestApplyActiveDtoEdit
     * @return
     * @throws DtoNullException
     */
    boolean updateContestApplyActiveRelationPerson(ContestApplyActiveDtoEdit contestApplyActiveDtoEdit) throws DtoNullException;

    /**
     * 第三阶段流程审核——竞赛结果审核
     *
     * @param contestApplyActiveDtoEdit
     * @return
     */
    boolean updateContestResult(ContestApplyActiveDtoEdit contestApplyActiveDtoEdit) throws DtoNullException;

    /**
     * 删除竞赛申请（放弃比赛）：将流程停掉即可
     *
     * @param contestApplyActiveDtoEdit
     * @return
     * @throws DtoNullException
     */
    boolean forbiddenContestApplyActive(ContestApplyActiveDto contestApplyActiveDto) throws DtoNullException;

    /**
     * 条件查询我的审核
     *
     * @param contestApplyActiveQuery
     * @return
     * @throws DtoNullException
     */
    DataResult<List<ContestApplyActiveVo>> queryContestApplyActive(ContestApplyActiveQuery contestApplyActiveQuery) throws DtoNullException;

    /**
     * 返回当前用户的竞赛申请
     *
     * @return
     */
    DataResult<List<ContestApplyActiveVo>> queryContestApplyUserActive(ContestApplyActiveQuery contestApplyActiveQuery) throws DtoNullException;

    /**
     * 根据ID查询竞赛申请
     *
     * @param id
     * @return
     * @throws DtoNullException
     */
    DataResult<Map<String, Object>> queryContestApplyActiveById(Long id) throws DtoNullException;

}
